﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Reflection;

namespace KingSite.Library.Mail {
    public class MailHelper {
        static IMailSetting mailSetting = new MailSetting();

        public static IMail GetInstance() {
            string[] type = mailSetting.MailType.Split(',');
            string a = type[1];
            string n = type[0];
            Assembly ass = Assembly.Load(a);
            Type[] t = ass.GetTypes();
            object o = ass.CreateInstance(n);
            IMail result = (IMail)o;
            return result;
        }
    }
}
